#include "mywidget.h"
#include "mytask.h"
#include <QPainter>


MyWidget::MyWidget(QWidget *parent) : QWidget(parent)
{

}

void MyWidget::paintEvent(QPaintEvent *event)
{
    int x= Tag_Num;
    //标签1
    QPen pen_1(QColor(200,101,102));
    QPainter painter_1(this);

    QPen pen_2(QColor(104,33,122));
    QPainter painter_2(this);
    painter_2.setPen(pen_2);
//    painter_2.drawLine(QPoint(0, 0), QPoint(888, 30));
    if(track_draw == 1) //开始绘制轨迹
    {
        for(int i = 0 ; i < Tag_Num ; i++)
        {
            if(i == 0)painter_1.setPen(pen_1);
            else if( i == 1)painter_1.setPen(pen_2);
            for(int j = 0 ; j < track_num[i]-4 ; j+=2)
            {
                painter_1.drawLine(TagPoint[i][j],TagPoint[i][j+1],TagPoint[i][j+2],TagPoint[i][j+3]);
            }
        }
    }
}
